package com.example.sfm.pojo.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@Schema(description = "成绩导入模板",name = "GradesImportDto")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GradesImportDto {
    @ExcelProperty("学号")
    @NotNull
    @Schema(description = "学号")
    private String studentNumber;

    @ExcelProperty("课程编号")
    @Schema(description = "课程编号")
    @NotNull private String courseCode;

    @ExcelProperty("成绩")
    @Schema(description = "成绩")
    @DecimalMin("0.00") @DecimalMax("100.00")
    private BigDecimal score;

    @ExcelProperty("考试日期（yyyy-MM-dd）")
    @DateTimeFormat("yyyy-MM-dd")
    @Schema(description = "考试日期")
    private LocalDate examDate;

    @ExcelProperty("备注")
    @Schema(description = "备注")
    private String remark;
}
